<?php 
	//man
	$sql = "SELECT `brand_title`,`brand_url` FROM `v_product` WHERE `category_id` = '1' GROUP BY `brand_id` ORDER BY `brand_id` ASC";
	$query = mysql_query($sql);
	$tp->Block('man');
	while($result = mysql_fetch_assoc($query)) { 
		$m_title	= strtoupper($result['brand_title']);
		$m_url		= $result['brand_url'];
		if($m_title){
			$tp->Apply();
		}
	}
	mysql_free_result($query);
	
	//woman
	$sql = "SELECT `brand_title`,`brand_url` FROM `v_product` WHERE `category_id` = '2' GROUP BY `brand_id` ORDER BY `brand_id` ASC";
	$query = mysql_query($sql);
	$tp->Block('woman');
	while($result = mysql_fetch_assoc($query)) { 
		$w_title	= strtoupper($result['brand_title']);
		$w_url		= $result['brand_url'];
		if($w_title){
			$tp->Apply();
		}
	}
	mysql_free_result($query);
	
	//kid
	$sql = "SELECT `brand_title`,`brand_url` FROM `v_product` WHERE `category_id` = '3' GROUP BY `brand_id` ORDER BY `brand_id` ASC";
	$query = mysql_query($sql);
	$tp->Block('kid');
	while($result = mysql_fetch_assoc($query)) { 
		$k_title	= strtoupper($result['brand_title']);
		$k_url		= $result['brand_url'];
		if($k_title){
			$tp->Apply();
		}
	}
	mysql_free_result($query);

?>